<template>
    <div>
      <br />

      <myheader/>

     
      <div class="container">

          <div class="item_column">
              <div class="left">   
                  
              </div>

              <div class="right"> 
                <br />
                <br />

                <h1>奖品审批</h1>
                <table border="1" cellspacing="1">
                    <tr>
                      <td>文章</td>
                      <td>操作</td>
                    </tr>
                    <tr v-for="i in wzlist" :key="i.id">
                      <td>{{i.title}}</td>
                      <td>
                        <van-button @click="tg(i.id)">通过</van-button>
                        <van-button @click="btg(i.id)">不通过</van-button>
                      </td>
                    </tr>
                  </table>
              
                
         
              </div>

          </div>

      </div>
      
    </div>
</template>
  
<script>
import maxios from '../http/axios'
import myheader from './myheader.vue'


  export default {
    components: {
      'myheader':myheader,
      
    },
  
    data() {
      return {
        wzlist: []
        

      }
    },

    methods: {
        get_wzlist(){
            maxios('/get_wz','get').then(res=>{
                this.wzlist = res.list
            })
    
        },
        
        tg(id){     
            maxios('/agreen?id='+id,'get').then(res=>{         
                if(res.code==200){           
                    alert('ok')          
                    this.get_wzlist()            
                }          
                else {            
                    alert('no')            
                }       
            })       
        },
        
        btg(id){      
            maxios('/noagreen?id='+id,'get').then(res=>{            
                if(res.code==200){          
                    alert('ok')            
                    this.get_wzlist()          
                }           
                else {            
                    alert('no')  
                }
        
            })
        
        }
        
    },
    mounted() {
        this.get_wzlist()
    }
  }
</script>
  
<style scoped>
@import url("../assets/style.css");

</style>